約 5,042,904 件
https://w.atwiki.jp/shells/pages/85.html
人に優しい連想配列を取得する-HashMapクラス- 【HP】 目次 ソースmap.jsp 実行結果 ソース map.jsp %@ page contentType="text/html; charset=Shift_JIS" import="java.util.*" % table border = "1" tr th キー名 /th th 値 /th /tr % HashMap objMap = new HashMap(); objMap.put( "ASP.NET","Active Server Page .NET" );// 第一引数をキーに、第二引数を値にセットする objMap.put( "PHP","PHP Hypertext Preprocessor" );// 要素順の管理を行わないので、必ずしも順番になるとは限らない objMap.put( "JSF","JavaServer Faces" ); Object[] objKey = objMap.keySet().toArray();// キーの一覧を toArrayメソッドでObject配列へ変換 for ( int i = 0; i objKey.length; i++ ) { % tr td %=objKey[i]% /td td %=objMap.get( objKey[i])% /td /tr % } % /table 実行結果 キー名 値 JSF Java Server Faces PHP PHP Hypertext Preprocessor ASP.NET Active Server Page .NET 戻る
https://w.atwiki.jp/machinelearning/pages/28.html
#include map #include set #include cmath #include stack #include queue #include string #include vector #include bitset #include fstream #include sstream #include stdio.h #include ctype.h #include string.h #include iostream #include algorithm #include sys/time.h using namespace std; #define li long long int #define rep(i,to) for(li i=0;i ((li)(to));++i) #define pb push_back #define sz(v) ((li)(v).size()) #define bit(n) (1ll (li)(n)) #define all(vec) (vec).begin(),(vec).end() #define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++) #define MP make_pair #define F first #define S second string label[]={"foot","eye","mouth"}; string type[]={"insect","non insect","alien"}; li data[][4]={ {2,2,1,1}, {6,2,1,0}, {2,0,1,1}, {6,0,1,0}, {4,2,1,1}, {2,8,4,0}, {9,9,9,2}}; struct Node{ vector pair li,Node child; string label; }; Node make(vector li remain,set li rem_label){ Node node; node.label=type[data[remain[0]][3]]; if(sz(rem_label)==0) return node; bool ok=false; rep(i,sz(remain)-1){ if(data[remain[i]][3]==data[remain[i+1]][3]) continue; ok=true; break; } if(!ok) return node; pair double,li best=MP(1e100,*rem_label.begin()); each(it,rem_label){ map li,pair li,map li,li mp; rep(i,sz(remain)){ mp[data[remain[i]][*it]].F++; mp[data[remain[i]][*it]].S[data[remain[i]][3]]++; } double sum=0; each(it0,mp){ double d=0; each(it1,it0- S.S){ double p=(double)it1- S/it0- S.F; d-=p*log(p); } sum+=d*((double)it0- S.F/sz(remain)); } best=min(best,MP(sum,*it)); } node.label=label[best.S]; rem_label.erase(best.S); map li,vector li mp; rep(i,sz(remain)) mp[data[remain[i]][best.S]].pb(remain[i]); each(it,mp) node.child.pb(MP(it- F,make(it- S,rem_label))); return node; } void print(Node node,int depth=0){ rep(i,depth) cout " "; cout node.label endl; rep(i,sz(node.child)){ rep(j,depth) cout " "; cout "- " node.child[i].F endl; print(node.child[i].S,depth+1); } } int main(){ Node node; set li s; vector li vec; rep(i,3) s.insert(i); rep(i,7) vec.pb(i); node=make(vec,s); print(node); }
https://w.atwiki.jp/prima/pages/2282.html
Blogs on Hanno Müller-Brachmann #bf レパートリー 作曲家名(全角フルネーム)に置き換えてください [部分編集] 作曲家名(全角フルネーム)に置き換えてください 作品名(全角)に置き換えてください役名(全角)に置き換えてください Last Update 2011/01/30 07 43ページ先頭へ
https://w.atwiki.jp/hmiku/pages/4017.html
【登録タグ Aether_EruCD CD CDP ゆうPCD ノアCD】 前作 本作 次作 P∴Rhythmatiq act 02 P∴Rhythmatiq EXTRA P∴Rhythmatiq act 03 ノア ゆうP Aether_Eru 発売:2008年12月29日 価格:¥500 流通:即売 サークル:P∴Rhythmatiq CD紹介 Aether_Eru、ゆう、Noahの3氏から成るサークルP∴Rhythmatiq(プリズマティック)のエクストラシングル。C75(08冬コミ)にて初頒布。 今回は、act 03に収録されるNoah氏の新曲のショートバージョンの先行公開に加え、ゲストボーカル mitsuko☆さんを迎えた『Snow Promenade -winter breath Ver.-』、さらに『Snow Promenade』の動画PVが二本立てと、エクストラという名前以上の豪華収録ぶり。 曲目 エレクトロガール / 曲:Noah Snow Promenade - winter breath Ver.- / 曲:ゆう、唄:mitsuko☆ Snow Promenade -Inst. Ver.- / 曲:ゆう EXTRA stage(PV) Snow Promenade / 曲:ゆう、映像:Aether_Eru Snow Promenade Acoustic ver / 曲:ゆう、映像:Aether_Eru リンク P∴Rhythmatiq EXTRA 作者ホームページ コメント 名前 コメント
https://w.atwiki.jp/openrpg/pages/11.html
開発方針についての議論ページ とりあえずRPGの基本仕様から策定・開発することになるかと思います。 ソースコードのライセンス方式(GPLかBSDか)についても議論が必要になると思います。 ※2008/6/19追記 とりあえず何かきっかけがないといけないと思うので、これからしばらくは大まかなカテゴリを作成していきます。 共同開発にあたって皆さんのご意見が必要です。 下部のコメントにご意見をお寄せください。 作成中の人がつくりかけの奴を公開してみると話が早そう -- 名無しさん (2008-06-11 18 30 12) 作りかけで放置してたマップエディタみたいなのがあるけど、制作するつもりが無いのでまとまらなさそう。 -- 名無しさん (2008-06-12 23 28 54) ↑見たいな人もとりあえずうpしてみれば?その人のスキルも分かるし。 -- 名無しさん (2008-06-18 01 48 17) http //pukiwiki.sourceforge.jp/?%E8%87%AA%E4%BD%9C%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%2Fcodehighlight.inc.php -- 名無しさん (2008-07-02 19 37 36) ココのプラグイン使えば -- 名無しさん (2008-07-02 19 40 46) 亀レスです。プラグインサンクスです。でもこのWikiはPukiWikiではないので使えません...ごめんなさい。 -- 196 ◆RGuhLsdBoc (2008-07-11 10 26 43) 名前 コメント
https://w.atwiki.jp/yakotest/pages/169.html
ああああ
https://w.atwiki.jp/mi_ic2/pages/134.html
TileEntityCrop 私はこのコードについて真に驚くべき解説ができるが、ここに記すには@Wikiの制限容量が少なすぎる。 バージョン: industrialcraft-2-2.2.828-experimental package ic2.core.crop; import ic2.api.crops.BaseSeed; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; import ic2.api.crops.ICropTile; import ic2.api.network.INetworkDataProvider; import ic2.api.network.INetworkUpdateListener; import ic2.core.IC2; import ic2.core.Ic2Items; import ic2.core.block.machine.tileentity.TileEntityCropmatron; import ic2.core.item.ItemCropSeed; import ic2.core.network.NetworkManager; import ic2.core.util.StackUtil; import ic2.core.util.Util; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.StatCollector; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; public class TileEntityCrop extends TileEntity implements INetworkDataProvider, INetworkUpdateListener, ICropTile { public byte humidity = -1; public byte nutrients = -1; public byte airQuality = -1; private static final boolean debug = false; private CropCard crop = null; public int size = 0; public int statGrowth = 0; public int statGain = 0; public int statResistance = 0; public int scanLevel = 0; public NBTTagCompound customData = new NBTTagCompound(); public int nutrientStorage = 0; public int waterStorage = 0; public int exStorage = 0; public int growthPoints = 0; public boolean upgraded = false; public char ticker; public boolean dirty; public static int tickRate = 256; public int weedlevel; public int Infestedlevel; public TileEntityCrop() { this.ticker = (char)IC2.random.nextInt(tickRate); this.dirty = true; this.weedlevel = 0; this.Infestedlevel = 0; } public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); if (nbt.hasKey( cropOwner ) nbt.hasKey( cropName )) { this.crop = Crops.instance.getCropCard(nbt.getString( cropOwner ), nbt.getString( cropName )); } else if (nbt.hasKey( cropid )) { this.crop = IC2Crops.getCropFromId(nbt.getShort( cropid )); } this.size = nbt.getByte( size ); this.statGrowth = nbt.getByte( statGrowth ); this.statGain = nbt.getByte( statGain ); this.statResistance = nbt.getByte( statResistance ); if (nbt.hasKey( data0 )) { for(int x = 0; x 16; ++x) { this.customData.setShort( legacy + x, nbt.getShort( data + x)); } } else if (nbt.hasKey( customData )) { this.customData = nbt.getCompoundTag( customData ); } this.growthPoints = nbt.getInteger( growthPoints ); this.nutrientStorage = nbt.getInteger( nutrientStorage ); this.waterStorage = nbt.getInteger( waterStorage ); this.exStorage = nbt.getInteger( exStorage ); this.upgraded = nbt.getBoolean( upgraded ); this.scanLevel = nbt.getByte( scanLevel ); this.weedlevel = nbt.getInteger( weedlevel ); this.Infestedlevel = nbt.getInteger( Infestedlevel ); } public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); if (this.crop != null) { nbt.setString( cropOwner , this.crop.owner()); nbt.setString( cropName , this.crop.name()); } nbt.setByte( size , (byte)this.size); nbt.setByte( statGrowth , (byte)this.statGrowth); nbt.setByte( statGain , (byte)this.statGain); nbt.setByte( statResistance , (byte)this.statResistance); nbt.setTag( customData , this.customData); nbt.setInteger( growthPoints , this.growthPoints); nbt.setInteger( nutrientStorage , this.nutrientStorage); nbt.setInteger( waterStorage , this.waterStorage); nbt.setInteger( exStorage , this.exStorage); nbt.setBoolean( upgraded , this.upgraded); nbt.setByte( scanLevel , (byte)this.scanLevel); nbt.setInteger( weedlevel , this.weedlevel); nbt.setInteger( Infestedlevel , this.Infestedlevel); } public void updateEntity() { super.updateEntity(); ++this.ticker; if (this.ticker % tickRate == 0) { this.tick();// 256MinecraftTickに1回呼ばれる } if (this.dirty) {// 更新が必要なら更新する this.dirty = false; this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.worldObj.updateLightByType(EnumSkyBlock.Block, this.xCoord, this.yCoord, this.zCoord); if (IC2.platform.isSimulating()) { Iterator var1 = this.getNetworkedFields().iterator(); while(var1.hasNext()) { String field = (String)var1.next(); ((NetworkManager)IC2.network.get()).updateTileEntityField(this, field); } } } } public List getNetworkedFields() { List ret = new ArrayList(4); ret.add( crop ); ret.add( size ); ret.add( upgraded ); ret.add( customData ); ret.add( weedlevel ); ret.add( Infestedlevel ); return ret; } public void tick() { if (IC2.platform.isSimulating()) { if (this.ticker % (tickRate 2) == 0) {// 1024Minecraftに1度、位相そのまま this.humidity = this.updateHumidity(); } if ((this.ticker + tickRate) % (tickRate 2) == 0) {// 1024Minecraftに1度、上の256tick前 this.nutrients = this.updateNutrients(); } if ((this.ticker + tickRate * 2) % (tickRate 2) == 0) {// 1024Minecraftに1度、上の256tick前 this.airQuality = this.updateAirQuality(); } if (this.crop == null) { if (!this.upgraded || !this.attemptCrossing()) {// upgradedなら何もしない、upgradedでないなら交配試行して成功したらスルー、交配失敗だと内部を実行 if (IC2.random.nextInt(100) != 0 || this.hasEx()) { if (this.exStorage 0 IC2.random.nextInt(10) == 0) { --this.exStorage; } return; } this.reset(); this.crop = IC2Crops.weed; this.size = 1; } assert this.crop != null; } this.crop.tick(this); if (this.crop.canGrow(this)) { this.growthPoints += this.calcGrowthRate(); if (this.crop == null) { return; } if (this.growthPoints = this.crop.growthDuration(this)) { this.growthPoints = 0; ++this.size; this.dirty = true; } } if (this.nutrientStorage 0) { --this.nutrientStorage; } if (this.waterStorage 0) { --this.waterStorage; } if (this.crop.isWeed(this) IC2.random.nextInt(50) - this.statGrowth = 2) { this.generateWeed(); } } } public void generateWeed() { int x = this.xCoord; int y = this.yCoord; int z = this.zCoord; switch(IC2.random.nextInt(4)) { case 0 ++x;// breakが足りない case 1 --x;// breakが足りない case 2 ++z;// breakが足りない case 3 --z; } if (this.worldObj.getTileEntity(x, y, z) instanceof TileEntityCrop) { TileEntityCrop teCrop = (TileEntityCrop)this.worldObj.getTileEntity(x, y, z); CropCard neighborCrop = teCrop.getCrop(); if (neighborCrop == null || !neighborCrop.isWeed(teCrop) IC2.random.nextInt(32) = teCrop.statResistance !teCrop.hasEx()) { int newGrowth = Math.max(this.statGrowth, teCrop.statGrowth); if (newGrowth 31 IC2.random.nextBoolean()) { ++newGrowth; } teCrop.reset(); teCrop.crop = IC2Crops.weed; teCrop.size = 1; teCrop.statGrowth = (byte)newGrowth; } } else if (this.worldObj.isAirBlock(x, y, z)) { Block block = this.worldObj.getBlock(x, y - 1, z); if (block == Blocks.dirt || block == Blocks.grass || block == Blocks.farmland) { this.worldObj.setBlock(x, y - 1, z, Blocks.grass, 0, 7); this.worldObj.setBlock(x, y, z, Blocks.tallgrass, 1, 7); } } } public boolean hasEx() { if (this.exStorage 0) { this.exStorage -= 5; return true; } else { return false; } } public boolean attemptCrossing() { if (IC2.random.nextInt(3) != 0) {// 確率で無条件失敗 return false; } else { List cropTes = new ArrayList(4);// 交配参加可能植物を列挙 this.askCropJoinCross(this.xCoord - 1, this.yCoord, this.zCoord, cropTes); this.askCropJoinCross(this.xCoord + 1, this.yCoord, this.zCoord, cropTes); this.askCropJoinCross(this.xCoord, this.yCoord, this.zCoord - 1, cropTes); this.askCropJoinCross(this.xCoord, this.yCoord, this.zCoord + 1, cropTes); if (cropTes.size() 2) {// 参加可能が2個未満で失敗 return false; } else { CropCard[] crops = (CropCard[])Crops.instance.getCrops().toArray(new CropCard[0]);// 全植物を列挙 if (crops.length == 0) {// 植物がないときは失敗 return false; } else { int[] ratios = new int[crops.length];// ここまでの累積交配比重 int total = 0; int search;// 全植物の交配比重の合計を計算 for(search = 0; search ratios.length; ++search) { CropCard crop = crops[search]; TileEntityCrop te; if (crop.canGrow(this)) { for(Iterator var7 = cropTes.iterator(); var7.hasNext(); total += this.calculateRatioFor(crop, te.getCrop())) { te = (TileEntityCrop)var7.next(); } } ratios[search] = total; } search = IC2.random.nextInt(total);// 累積交配比重に準じた乱数 int min = 0; int max = ratios.length - 1; int count; while(min max) {// minをsearchに対応したcropsのインデックスにする count = (min + max) / 2; int value = ratios[count]; if (search value) { max = count; } else { min = count + 1; } } assert min == max; assert min = 0 min ratios.length; assert ratios[min] search; assert min == 0 || ratios[min - 1] = search; this.upgraded = false; this.crop = crops[min]; this.dirty = true; this.size = 1; this.statGrowth = 0; this.statResistance = 0; this.statGain = 0; TileEntityCrop te;// 交配参加した作物の合計計算 for(Iterator var13 = cropTes.iterator(); var13.hasNext(); this.statGain += te.statGain) { te = (TileEntityCrop)var13.next(); this.statGrowth += te.statGrowth; this.statResistance += te.statResistance; } count = cropTes.size(); this.statGrowth /= count; this.statResistance /= count; this.statGain /= count;// ここまででGGRが交配参加した作物の平均になっている this.statGrowth += IC2.random.nextInt(1 + 2 * count) - count;// -count~count this.statGain += IC2.random.nextInt(1 + 2 * count) - count; this.statResistance += IC2.random.nextInt(1 + 2 * count) - count; this.statGrowth = Util.limit(this.statGrowth, 0, 31); this.statGain = Util.limit(this.statGain, 0, 31); this.statResistance = Util.limit(this.statResistance, 0, 31); return true; } } } } public int calculateRatioFor(CropCard newCrop, CropCard oldCrop) { if (newCrop == oldCrop) {// 同一植物だと500 return 500; } else { int value = 0;// 交配比重、初期値0 int diff;// statが完全に同一の時+10、statが1ずれるごとに-1のペナルティ int delta; for(diff = 0; diff 5; ++diff) { delta = Math.abs(newCrop.stat(diff) - oldCrop.stat(diff)); value += -delta + 2; } String[] var12 = newCrop.attributes();// 属性が大文字小文字無視で一致するごとに+5 delta = var12.length; for(int var6 = 0; var6 delta; ++var6) { String attributeNew = var12[var6]; String[] var8 = oldCrop.attributes(); int var9 = var8.length; for(int var10 = 0; var10 var9; ++var10) { String attributeOld = var8[var10]; if (attributeNew.equalsIgnoreCase(attributeOld)) { value += 5; } } } diff = newCrop.tier() - oldCrop.tier();// Tier増分が正の場合2倍ペナルティ、負の場合1倍ペナルティ if (diff 1) { value -= 2 * diff; } if (diff -3) { value -= -diff; } return Math.max(value, 0); } } public void askCropJoinCross(int x, int y, int z, List crops) { TileEntity te = this.worldObj.getTileEntity(x, y, z); if (te instanceof TileEntityCrop) {// ブロックが支柱で、 TileEntityCrop sideCrop = (TileEntityCrop)te; CropCard neighborCrop = sideCrop.getCrop(); if (neighborCrop != null) {// 植物が存在し、 if (neighborCrop.canGrow(this) neighborCrop.canCross(sideCrop)) {// その植物種が交配後の位置で成長可能であり、交配前の位置で交配可能である場合、 int base = 4;// 初期値4 if (sideCrop.statGrowth = 16) {// Gr16で1のボーナス ++base; } if (sideCrop.statGrowth = 30) {// Gr30で1のボーナス ++base; } if (sideCrop.statResistance = 28) {// Re28以降1ずつペナルティ base += 27 - sideCrop.statResistance; } if (base = IC2.random.nextInt(20)) {// (base + 1) / 20が交配参加確率。 crops.add(sideCrop); } } } } } public boolean leftClick(EntityPlayer player) { if (this.crop == null) { if (this.upgraded) { this.upgraded = false; this.dirty = true; if (IC2.platform.isSimulating()) { StackUtil.dropAsEntity(this.worldObj, this.xCoord, this.yCoord, this.zCoord, new ItemStack(Ic2Items.crop.getItem())); } return true; } else { return false; } } else { return this.crop.leftclick(this, player); } } public boolean pick(boolean manual) { if (this.crop == null) { return false; } else { boolean bonus = this.harvest(false); float firstchance = this.crop.dropSeedChance(this); int drop; for(drop = 0; drop this.statResistance; ++drop) { firstchance *= 1.1F; } drop = 0; int x; if (bonus) { if (IC2.random.nextFloat() = (firstchance + 1.0F) * 0.8F) { ++drop; } float chance = this.crop.dropSeedChance(this) + (float)this.statGrowth / 100.0F; if (!manual) { chance *= 0.8F; } for(x = 23; x this.statGain; ++x) { chance *= 0.95F; } if (IC2.random.nextFloat() = chance) { ++drop; } } else if (IC2.random.nextFloat() = firstchance * 1.5F) { ++drop; } ItemStack[] re = new ItemStack[drop]; for(x = 0; x drop; ++x) { re[x] = this.crop.getSeeds(this); } this.reset(); if (IC2.platform.isSimulating() re.length 0) { for(x = 0; x re.length; ++x) { if (re[x].getItem() != Ic2Items.cropSeed.getItem()) { re[x].stackTagCompound = null; } StackUtil.dropAsEntity(this.worldObj, this.xCoord, this.yCoord, this.zCoord, re[x]); } } return true; } } public boolean rightClick(EntityPlayer player) { ItemStack current = player.getCurrentEquippedItem(); boolean creative = player.capabilities.isCreativeMode; if (current != null) { if (this.crop == null) { if (current.getItem() == Ic2Items.crop.getItem() !this.upgraded) { if (!creative) { --current.stackSize; if (current.stackSize = 0) { player.inventory.mainInventory[player.inventory.currentItem] = null; } } this.upgraded = true; this.dirty = true; return true; } if (this.applyBaseSeed(player)) { return true; } } if (current.getItem() == Items.water_bucket || current.getItem() == Ic2Items.waterCell.getItem()) { if (this.waterStorage 10) { this.waterStorage = 10; return true; } return current.getItem() == Items.water_bucket; } if (current.getItem() == Items.wheat_seeds) { if (this.nutrientStorage = 50) { this.nutrientStorage += 25; --current.stackSize; if (current.stackSize = 0) { player.inventory.mainInventory[player.inventory.currentItem] = null; } return true; } return false; } if (current.getItem() == Items.dye current.getItemDamage() == 15 || current.getItem() == Ic2Items.fertilizer.getItem()) { if (this.applyFertilizer(true)) { if (creative) { return true; } else { --current.stackSize; if (current.stackSize = 0) { player.inventory.mainInventory[player.inventory.currentItem] = null; } return true; } } else { return false; } } if (current.getItem() == Ic2Items.hydratingCell.getItem()) { if (this.applyHydration(true, current, player)) { if (current.stackSize = 0) { player.inventory.mainInventory[player.inventory.currentItem] = null; } return true; } return false; } if (current.getItem() == Ic2Items.weedEx.getItem() this.applyWeedEx(true)) { current.damageItem(1, player); if (current.stackSize = 0) { player.inventory.mainInventory[player.inventory.currentItem] = null; } return true; } } if (this.crop == null) { return false; } else { return this.crop.rightclick(this, player); } } public boolean applyBaseSeed(EntityPlayer player) { ItemStack current = player.getCurrentEquippedItem(); BaseSeed seed = Crops.instance.getBaseSeed(current); if (seed != null) { if (current.stackSize seed.stackSize) { return false; } if (this.tryPlantIn(seed.crop, seed.size, seed.statGrowth, seed.statGain, seed.statResistance, 1)) { if (player.capabilities.isCreativeMode) { return true; } if (current.getItem().hasContainerItem(current)) { if (current.stackSize 1) { return false; } player.inventory.mainInventory[player.inventory.currentItem] = current.getItem().getContainerItem(current); } else { current.stackSize -= seed.stackSize; if (current.stackSize = 0) { player.inventory.mainInventory[player.inventory.currentItem] = null; } } return true; } } return false; } public boolean tryPlantIn(CropCard crop, int si, int statGr, int statGa, int statRe, int scan) { if (crop != null crop != IC2Crops.weed !this.upgraded) { if (!crop.canGrow(this)) { return false; } else { this.reset(); this.crop = crop; this.size = (byte)si; this.statGrowth = (byte)statGr; this.statGain = (byte)statGa; this.statResistance = (byte)statRe; this.scanLevel = (byte)scan; return true; } } else { return false; } } public boolean applyFertilizer(boolean manual) { if (this.nutrientStorage = 100) { return false; } else { this.nutrientStorage += manual ? 100 90; return true; } } public boolean applyHydration(TileEntityCropmatron cropmatron) { if (this.waterStorage = 200) { return false; } else { int apply = 200 - this.waterStorage; FluidStack drain = cropmatron.getFluidTank().drain(apply, true); if (drain != null) { this.waterStorage += drain.amount; return true; } else { return false; } } } public boolean applyHydration(boolean manual, ItemStack itemStack, EntityPlayer player) { if ((manual || this.waterStorage 180) this.waterStorage 200) { int apply = manual ? 200 - this.waterStorage 180 - this.waterStorage; apply = Math.min(apply, itemStack.getMaxDamage() - itemStack.getItemDamage()); if (!player.capabilities.isCreativeMode itemStack.attemptDamageItem(apply, IC2.random)) { player.inventory.mainInventory[player.inventory.currentItem] = Ic2Items.cell; } this.waterStorage += apply; return true; } else { return false; } } public boolean applyWeedEx(boolean manual) { if ((this.exStorage 100 || !manual) this.exStorage 150) { this.exStorage += 50; boolean triggerDecline; if (manual) { triggerDecline = this.worldObj.rand.nextInt(5) == 0; } else { triggerDecline = this.worldObj.rand.nextInt(3) == 0; } if (this.crop != null this.crop.isWeed(this) this.exStorage = 75 triggerDecline) { switch(this.worldObj.rand.nextInt(5)) { case 0 if (this.statGrowth 0) { --this.statGrowth; } case 1 if (this.statGain 0) { --this.statGain; } default if (this.statResistance 0) { --this.statResistance; } } } return true; } else { return false; } } public ItemStack[] harvest_automated(boolean optimal) { if (this.crop == null) { return null; } else if (!this.crop.canBeHarvested(this)) { return null; } else if (optimal this.size != this.crop.getOptimalHavestSize(this)) { return null; } else { double chance = (double)this.crop.dropGainChance(); chance *= Math.pow(1.03D, (double)this.statGain); int dropCount = (int)Math.max(0L, Math.round(IC2.random.nextGaussian() * chance * 0.6827D + chance)); ItemStack[] ret = new ItemStack[dropCount]; for(int i = 0; i dropCount; ++i) { ret[i] = this.crop.getGain(this); if (ret[i] != null IC2.random.nextInt(100) = this.statGain) { ++ret[i].stackSize; } } this.size = this.crop.getSizeAfterHarvest(this); this.dirty = true; return ret; } } public boolean harvest(boolean manual) { ItemStack[] drops = this.harvest_automated(false); if (drops == null) { return false; } else { if (IC2.platform.isSimulating() drops.length 0) { ItemStack[] var3 = drops; int var4 = drops.length; for(int var5 = 0; var5 var4; ++var5) { ItemStack drop = var3[var5]; StackUtil.dropAsEntity(this.worldObj, this.xCoord, this.yCoord, this.zCoord, drop); } } return true; } } public void onNeighbourChange() { if (this.crop != null) { this.crop.onNeighbourChange(this); } } public int emitRedstone() { return this.crop == null ? 0 this.crop.emitRedstone(this); } public void onBlockDestroyed() { if (this.crop != null) { this.crop.onBlockDestroyed(this); } } public int getEmittedLight() { return this.crop == null ? 0 this.crop.getEmittedLight(this); } public byte getHumidity() { if (this.humidity == -1) { this.humidity = this.updateHumidity(); } return this.humidity; } public byte getNutrients() { if (this.nutrients == -1) { this.nutrients = this.updateNutrients(); } return this.nutrients; } public byte getAirQuality() { if (this.airQuality == -1) { this.airQuality = this.updateAirQuality(); } return this.airQuality; } public byte updateHumidity() { int value = Crops.instance.getHumidityBiomeBonus(this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord)); if (this.worldObj.getBlockMetadata(this.xCoord, this.yCoord - 1, this.zCoord) = 7) { value += 2; } if (this.waterStorage = 5) { value += 2; } value += (this.waterStorage + 24) / 25; return (byte)value; } public byte updateNutrients() { int value = Crops.instance.getNutrientBiomeBonus(this.worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord)); for(int i = 2; i 5 this.worldObj.getBlock(this.xCoord, this.yCoord - i, this.zCoord) == Blocks.dirt; ++i) { ++value; } value += (this.nutrientStorage + 19) / 20; return (byte)value; } public byte updateAirQuality() { int value = 0; int height = (this.yCoord - 64) / 15; if (height 4) { height = 4; } if (height 0) { height = 0; } int value = value + height; int fresh = 9; for(int x = this.xCoord - 1; x = this.xCoord + 1 fresh 0; ++x) { for(int z = this.zCoord - 1; z = this.zCoord + 1 fresh 0; ++z) { if (this.worldObj.isBlockNormalCubeDefault(x, this.yCoord, z, false) || this.worldObj.getTileEntity(x, this.yCoord, z) instanceof TileEntityCrop) { --fresh; } } } value += fresh / 2; if (this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) { value += 2; } return (byte)value; } public int updateMultiCulture() { Set crops = new HashSet(); for(int x = -1; x 1; ++x) { for(int z = -1; z 1; ++z) { TileEntity te = this.worldObj.getTileEntity(x + this.xCoord, this.yCoord, z + this.zCoord); if (te instanceof TileEntityCrop) { CropCard neighborCrop = ((TileEntityCrop)te).getCrop(); if (neighborCrop != null) { crops.add(neighborCrop); } } } } return crops.size() - 1; } public void addIfNotPresent(CropCard crop, LinkedList crops) { for(int i = 0; i crops.size(); ++i) { if (crop == crops.get(i)) { return; } } crops.add(crop); } public int calcGrowthRate() { if (this.crop == null) { return 0; } else { int base = 3 + IC2.random.nextInt(7) + this.statGrowth; int need = (this.crop.tier() - 1) * 4 + this.statGrowth + this.statGain + this.statResistance; if (need 0) { need = 0; } int have = this.crop.weightInfluences(this, (float)this.getHumidity(), (float)this.getNutrients(), (float)this.getAirQuality()) * 5; if (have = need) { base = base * (100 + (have - need)) / 100; } else { int neg = (need - have) * 4; if (neg 100 IC2.random.nextInt(32) this.statResistance) { this.reset(); base = 0; } else { base = base * (100 - neg) / 100; if (base 0) { base = 0; } } } return base; } } public void calcTrampling() { if (IC2.platform.isSimulating()) { if (IC2.random.nextInt(100) == 0 IC2.random.nextInt(40) this.statResistance) { this.reset(); this.worldObj.setBlock(this.xCoord, this.yCoord - 1, this.zCoord, Blocks.dirt, 0, 7); } } } public void onEntityCollision(Entity entity) { if (this.crop != null) { if (this.crop.onEntityCollision(this, entity)) { this.calcTrampling(); } } } public void reset() { this.crop = null; this.size = 0; this.customData = new NBTTagCompound(); this.dirty = true; this.statGain = 0; this.statResistance = 0; this.statGrowth = 0; this.nutrients = -1; this.airQuality = -1; this.humidity = -1; this.growthPoints = 0; this.upgraded = false; this.scanLevel = 0; } public void updateState() { this.dirty = true; } public String getScanned() { if (this.crop == null) { return null; } else if (this.scanLevel = 0) { return null; } else { String name = StatCollector.translateToLocal(this.crop.displayName()); return this.scanLevel = 4 ? String.format( %s - Gr %d Ga %d Re %d S %d/%d , name, this.statGrowth, this.statGain, this.statResistance, this.size, this.crop.maxSize()) String.format( %s - Size %d/%d , name, this.size, this.crop.maxSize()); } } public boolean isBlockBelow(Block reqBlock) { if (this.crop == null) { return false; } else { for(int i = 1; i this.crop.getrootslength(this); ++i) { Block block = this.worldObj.getBlock(this.xCoord, this.yCoord - i, this.zCoord); if (block.isAir(this.worldObj, this.xCoord, this.yCoord - i, this.zCoord)) { return false; } if (block == reqBlock) { return true; } } return false; } } public boolean isBlockBelow(String oreDictionaryName) { if (this.crop == null) { return false; } else { for(int i = 1; i this.crop.getrootslength(this); ++i) { Block block = this.worldObj.getBlock(this.xCoord, this.yCoord - i, this.zCoord); int metaData = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord - i, this.zCoord); if (block.isAir(this.worldObj, this.xCoord, this.yCoord - i, this.zCoord)) { return false; } for(int aux = 0; aux OreDictionary.getOres(oreDictionaryName).size(); ++aux) { ItemStack itemStack = (ItemStack)OreDictionary.getOres(oreDictionaryName).get(aux); if (itemStack.getItem() == Item.getItemFromBlock(block) itemStack.getItemDamage() == metaData) { return true; } } } return false; } } public ItemStack generateSeeds(CropCard crop, byte growth, byte gain, byte resis, byte scan) { return ItemCropSeed.generateItemStackFromValues(crop, growth, gain, resis, scan); } public ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan) { return this.generateSeeds(IC2Crops.getCropFromId(plant), growth, gain, resis, scan); } public void onNetworkUpdate(String field) { this.dirty = true; } public CropCard getCrop() { return this.crop; } public short getID() { return (short)Crops.instance.getIdFor(this.crop); } public byte getSize() { return (byte)this.size; } public byte getGrowth() { return (byte)this.statGrowth; } public byte getGain() { return (byte)this.statGain; } public byte getResistance() { return (byte)this.statResistance; } public byte getScanLevel() { return (byte)this.scanLevel; } public NBTTagCompound getCustomData() { return this.customData; } public int getNutrientStorage() { return this.nutrientStorage; } public int getHydrationStorage() { return this.waterStorage; } public int getWeedExStorage() { return this.exStorage; } public int getLightLevel() { return this.worldObj.getBlockLightValue(this.xCoord, this.yCoord, this.zCoord); } public void setCrop(CropCard cropCard) { this.crop = cropCard; this.dirty = true; } public void setID(short id) { this.setCrop(IC2Crops.getCropFromId(id)); } public void setSize(byte size1) { this.size = size1; this.dirty = true; } public void setGrowth(byte growth) { this.statGrowth = growth; } public void setGain(byte gain) { this.statGain = gain; } public void setResistance(byte resistance) { this.statResistance = resistance; } public void setScanLevel(byte scanLevel1) { this.scanLevel = scanLevel1; } public void setNutrientStorage(int nutrientStorage1) { this.nutrientStorage = nutrientStorage1; } public void setHydrationStorage(int hydrationStorage) { this.waterStorage = hydrationStorage; } public void setWeedExStorage(int weedExStorage) { this.exStorage = weedExStorage; } public World getWorld() { return this.worldObj; } public ChunkCoordinates getLocation() { return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord); } public int getvisualweedlevel() { return this.weedlevel; } public int getvisualInfestedlevel() { if (this.Infestedlevel 10) { return 0; } else if (this.Infestedlevel 30) { return 1; } else if (this.Infestedlevel 50) { return 2; } else if (this.Infestedlevel 70) { return 3; } else { return this.Infestedlevel 90 ? 4 5; } } }
https://w.atwiki.jp/antiqrm/pages/108.html
*制作日記連投 ・デフォは昇順だがこの引用は降順(そのため↓は上の記事を指す) ・同日でも各記事更新時間ばらばら ・誰なのかよく分らない連投っぷり ・公式で一般に公開されていた制作日記 ・見えない何かとちょっぴり交換日記風味 ・その後【[[パス付制作日記]]】へ 2007年11月10日の制作日記 #blockquote(){11月10日 カウンターがおかしくなってしまったので付け直しました。 500万HITが近付いているので時間があれば何か出来たらいいという話題が持ち上がっていたので、その時点では400万HIT前後だったと思います。 400万HITで設定しておきました。} #blockquote(){11月10日 怖いことに、一ヶ月半近く収録していて未だに未完了。 帽子屋さんはなんとかサンプル上げれましたが、公開スケジュール通りにいくと次はネズミさん。 そのネズミが終わらないからトカゲさんも上げられない。 新キャラで止まってしまっていますね。 完了まであと少し。ネズミさんと帽子屋さん待ちです。 頑張れー。 ↓業務連絡っぽいですよ…。私が書いても業務連絡っぽいけども。 カウンターは395万あたりだったと思う。だいたい合っていると思います。} #blockquote(){11月10日 残すところ2キャラ…! 収録、やっと終わりが見えてきましたね。} 2007年11月13日の制作日記 #blockquote(){11月13日 収録終わりましたー!} #blockquote(){11月13日 お疲れ様です! そして、これからが本番でしょう!まだまだ終わりませんね。泣ける!} #blockquote(){11月13日 泣いたら疲れるから泣かずに頑張って。あと一息。一息長いけど。} #blockquote(){11月13日 メッセージを更新ついでに確認していて気付いたのですが、 続きそうなコメントをいただけていますが今のところそんな具体的な計画はありません。 今を生きるのに精一杯!ノープラン! 完全なノープランは嘘だとして、ともかく今回です、今回。} #blockquote(){11月13日 朝方に連続更新されていたみたいで悲しくなりました…。 寝てしまっていたのが申し訳のない気分です。 半年以上前からスケジュール組んでいるはずなのにどうしてここはいつもこんなにぎりなんだと思ったけど、どこも同じですね。 自分も二ヶ月ほど全休とってないことに気がついた。 ハートのときはもっとぎりだったはずです。 幕張に行けなかった分を無駄にしないためにもだましだまし半休をとって頑張りましょう。} #blockquote(){11月13日 更新が続きますね。 久しぶりに雑談日記らしい。 今のところ順調です。 スケジュール通り。 と、書いておきます。} その後の制作日記は【[[『告知・外部向け』とパス付『関係者向け』 パス付制作日記]]】に分離 ----
https://w.atwiki.jp/maimuzo/pages/53.html
プラグイン名 BenchmarkForRailsプラグイン このプラグインができること 標準のプロファイラより細かくベンチマークを取ってくれる 標準のプロファイラが計測できないところも計測してくれる 2008/8/21現在、Rails2.1系ではエラーが出ている模様 よって実際に使ってないので注意 ちょー簡単な使い方 ruby script/plugin install http //benchmarkforrails.googlecode.com/svn/trunk mv vendor/plugins/trunk vendor/plugins/BenchmarkForRails でインストールするだけ。(?) 詳しくはvender/plugins/BenchmarkForRails/init.rbを見よう。 公式ページ BenchmarkForRails new benchmarking plugin codelevy benchmarkforrails - Google Code 日本語解説ページ ないっス 外国語解説ページ あるかもしれないけど、必要なくね? コメント 名前
https://w.atwiki.jp/sh-03c/pages/24.html
Androidアプリ リンク先はマーケットや紹介サイトになっています。断りがないかぎりは無料のものだけ。 Androidアプリ最初に入れるべきアプリは? Android Market - Web版 アプリ紹介サイト アプリHome変更 日本語IME 日本語IMEプラグイン (マッシュルーム) カレンダー スケジューラー 時計 テキストエディタ Webブラウザ 音楽 2chブラウザ - @Wiki メール関連 動画関連 バッテリー関連 Twitterクライアント ユーティリティ お得情報&クーポン系 ニュース&情報誌 その他 最初に入れるべきアプリは? QRコードスキャナー(本体標準のものはマーケット非対応)、Astro File Manager、Quick Setting、Battery Status Free、Meridianあたりはとりあえず入れておいて損なし。 ステータスバーを下げるためのHelloStatusBarもベールビューや留守録用にホームに置いておきたい。 ホーム画面が重いと感じたらADW.LauncherかLauncher Proも。 日本語IMEのATOKトライアルもよい感じです。 Android Market - Web版 Web版の公式Androidマーケットです。 アプリの検索。 アプリランキングの参照。 ユーザーレビューの閲覧。 インストール済みのアプリ(ダウンロード履歴かも)の参照。(表示されないものもある) リモートでのアプリのインストール。 などができます。 アプリ紹介サイト アンドロイダー オクトバ オリコンアプリランキング mobile ASCII for Android 萌えドロイド 萌えアプリ専用 andronavi AndroApp meetroid giveApp de ANDROID Appinfo AndRanking APPmax pandroid applizoo マーケット検索 AndroLib マーケット検索 AppBrain マーケット検索、アプリの同期 ランキングロイド アプリオ appliko アプリ Home変更 ADW.Launcher Home画面がやや重いので、これに代えるといい感じになるかと。 LauncherPRO 軽めのホーム変更ユーティリティ。 Home Switcher (紹介) ホームアプリの簡単切り替え。(2.2用) 日本語IME ATOKトライアル 試用期間は6月末まで(延長しました) OpenWnnフリック入力対応版 Simeji (紹介) 日本語IMEプラグイン (マッシュルーム) マッシュルームパック 連絡先の情報/メルアドピッカー/音声/時刻。 aNdClip クリップボード拡張 Free版 クリップボードを拡張する。アドレス帳も参照可能。 Google変換マッシュ Web版Google日本語入力で変換。 Social IME Mushroom Plug-in Social IMEで変換。 カオ帳 顔文字入力を支援。 カレンダー スケジューラー S2カレンダーウィジェット ジョルテ システム手帳アプリ 時計 diviClock 世界天気時計 テキストエディタ AK Notepad Webブラウザ Dolphine Browser Galapagos Browser Opera Mini - ちょっとクセがある Skyfire Browser 音楽 WinAMP - 無線LAN経由でPCの音楽ファイルを同期できる。 Meridian Ringdroid - MP3を編集して好きな部分を着信音として使える。 2chブラウザ - @Wiki 一長一短だけども野良アプリインストールに抵抗なければTuboroidonがよさげ。 Tuboroidon 開発終了したTuboroidのソースを引き継いだブラウザ。 Tuboroidon524 Tuboroidonをさらに改変。 2chMate Tuboroidonと同じ作者。→広告付きマーケット版 俺2ch Anちゃん En2ch ニブロイド Nora(β) W2Chの人 Ace2ch Bettik Balloo! for Android(β) (紹介) テレビ実況専用。2ch実況対応。 メール関連 IMoNi iモード.netのクライアント spモードメール ドコモwebメール ビューア 動画関連 RockPlayer Lite Androidの基本動画アプリ VitalPlayer FFmpegベースの動画アプリ。RockPlayerより軽い? Ustream ライブストリーミング放送。 Qik VIDEO NicoRo α版 ニコニコ動画 ニコニコPlayer(仮) ニコニコ動画 バッテリー関連 Battery Status Free ステータスバーとウィジェットでバッテリーの%表示 DQB 一発ネタに見えるけど実用的 CPU Full Works - CPUを目いっぱいブン回してバッテリーを食わせる Battery Graph (紹介) バッテリー量のログを取り、グラフで見ることができる。SH-03Cではバッテリー量の精度が10%単位なのがちょっと残念です。 Auto WiFi Toggle 定期的にWiFiをオンにし、接続できなければオフにします。 Twitterクライアント 日本語twitterクライアント twicca イチオシ……というか日本語アプリはこれくらいTWICCA TWIPICプラグイン 独断と偏見によるAndroidのTwitterクライアントレビュー (ケータイ Watch) ユーティリティ QRコードスキャナー 本体標準のものはマーケットに対応していないので必須。 APNdroid 電話は使えるようにしたまま、3G回線を切るアプリ。OFFの時にAPN名を書き換えているのでアンインストールはONの状態ですること。 Advanced Task Killer - バックグランドで動いているアプリを終了させることができる。 Task Manager - 同上 Astro File Manager - ファイラーならこれ。 ES ファイルエクスプローラー - サーバに接続可能なファイラー。マニア向けだけど便利。 HelloStatusBar - ステータスバーを上げ下げするだけのアプリ。 Adobe Photoshop Express 簡単な画像編集ができる Perfect Viewer コミック閲覧にも適した画像ビューア。 Astro File Managerと合わせて使うと吉 SwiFTP Server (紹介) FTPサーバ。便利。 Bluetooth File Transfer Bluetoothでファイル共有。 More Icons Widget - ホームにアイコンをいっぱい置きたい方に。Free版と有料版があります Quick settings - GPSやBluetoothの設定などをすぐに変更できる Quick System Info - ストレージやRAMの空き容量や現在のIPアドレスなどを一括して見ることができる、Logcatの閲覧も可能 Desktop VisuallizeR - ホーム画面のアイコンやラベルを自由に変えることができる 発信確認 Call confirm - 電話をかける直前に割り込んで誤発信を防いでくれる Fast Reboot - 電源を切らずに再起動できる My docomo checker docomoの料金や契約状況などを見ることが出来ます。My docomoアカウントはiモードメールが使えない場合は郵送しないと登録できないらしいので事前に登録しておきましょう。 お得情報&クーポン系 折り込みチラシビューアー ホットペッパー グルメ マクドナルド公式アプリ ニュース&情報誌 ウェザーニュースタッチ 気象情報。 ITmedia for Android ITmediaニュース Impress Watchニュース R25 for android リクルートのフリーペーパー その他 Latte テレビ番組表を取得するアプリ Skype マーケットから落とせるようになりました。 乗換案内 - 携帯サイトでお馴染のところ たいぷぅ (紹介) 文字入力の練習にどうぞ。 ボトルメッセージ 不特定の相手にメッセージを送信。 日本交通タクシー配車 (紹介) 東京23区・武蔵野市・三鷹市で利用可能